interface requestType {
    code: number,
    message: string,
    data?: any
}
export default defineEventHandler(async (event) => {
    const rebody = await readBody(event);
    try {
        const res = await $fetch<requestType>(`http://localhost:3005/api/playHistory`, {
            method: "post",
            body: {
                username: rebody.username,
                musicName: rebody.musicName,
                musicId: rebody.musicId,
                albumName: rebody.albumName,
                singer: rebody.singer,
                time: rebody.time,
                cover: rebody.cover
            }
        })
        return res;
    }
    catch (error) {
        return error
    }
})